import request from '@/utils/request'

// 分页查询
export const queryPageApi = (data) => request.get('/users', {params: data})

// 查询所有部门
export const queryDeptListApi = () => request.get('/depts/list')

// 添加用户
export const addApi = (data) => request.post('/users', data)

// 根据ID查询用户
export const queryByIdApi = (id) => request.get(`/users/${id}`)

// 修改用户
export const updateApi = (data) => request.put('/users', data)

// 删除用户
export const deleteByIdApi = (id) => request.delete(`/users/${id}`)

// 查询所有角色
export const queryRoleListApi = () => request.get('/roles/list')

// 文件上传
export const uploadApi = (data) => request.post('/upload', data, {
  headers: {
    'Content-Type': 'multipart/form-data'
  }
}) 